package com.atguigu.online_edu.flume.utils;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONException;

/**
 * @version 1.0
 * @ClassName：JSONUtil
 * @Author: 拓路者8521
 * @Date: 2022/7/20 18:11
 * @Description:
 */
public class JSONUtil {
    /*
     * 通过异常判断是否是json字符串
     * 是：返回true  不是：返回false
     * */
    public static boolean isJSONValidate(String log){
        try {
            JSONObject.parseObject(log);
            return true;
        }catch (JSONException e){
            return false;
        }
    }

}
